package com.example.community;

import com.example.community.dao.LoginTicketMapper;
import com.example.community.entity.LoginTicket;
//import org.junit.jupiter.api.Test;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

@SpringBootTest
public class testLoginMapper {
    @Autowired
    LoginTicketMapper loginTicketMapper;
    @Test
    void test(){
        LoginTicket loginTicket = new LoginTicket();
        loginTicket.setTicket("abc");
        loginTicket.setStatus(1);
        loginTicket.setUserId(113);
        loginTicket.setExpired(new Date(System.currentTimeMillis() + 1000 * 60 * 10));
        System.out.println(loginTicketMapper.insertLoginTicket(loginTicket));
    }
    @Test
    void testSelect(){
        System.out.println(loginTicketMapper.selectByTicket("abc"));
    }
    @Test
    void testUpdate(){
        System.out.println(loginTicketMapper.updateStatus("abc",11));
    }
}
